Proper connect_port
[juce-lv2.git] / juce / source / extras / the jucer / src / ui / jucer_PaintRoutineEditor.h
blob0965fe024c3c52e2fc107e96441c7ad8ce9c46a2
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCER_PAINTROUTINEEDITOR_JUCEHEADER__
27 #define __JUCER_PAINTROUTINEEDITOR_JUCEHEADER__
29 #include "../model/jucer_JucerDocument.h"
30 #include "../model/jucer_PaintRoutine.h"
31 #include "jucer_SnapGridPainter.h"
32 class JucerDocumentHolder;
35 //==============================================================================
36 /**
38 class PaintRoutineEditor : public Component,
39 public ChangeListener,
40 public LassoSource <PaintElement*>,
41 public FileDragAndDropTarget
43 public:
44 //==============================================================================
45 PaintRoutineEditor (PaintRoutine& graphics,
46 JucerDocument& document,
47 JucerDocumentHolder* const docHolder);
48 ~PaintRoutineEditor();
50 //==============================================================================
51 void paint (Graphics& g);
52 void paintOverChildren (Graphics& g);
53 void resized();
54 void changeListenerCallback (ChangeBroadcaster*);
56 void mouseDown (const MouseEvent& e);
57 void mouseDrag (const MouseEvent& e);
58 void mouseUp (const MouseEvent& e);
59 void visibilityChanged();
61 void findLassoItemsInArea (Array <PaintElement*>& results, const Rectangle<int>& area);
63 SelectedItemSet <PaintElement*>& getLassoSelection();
65 bool isInterestedInFileDrag (const StringArray& files);
66 void filesDropped (const StringArray& filenames, int x, int y);
68 const Rectangle<int> getComponentArea() const;
70 //==============================================================================
71 void refreshAllElements();
73 private:
74 PaintRoutine& graphics;
75 JucerDocument& document;
76 JucerDocumentHolder* const documentHolder;
77 LassoComponent <PaintElement*> lassoComp;
78 SnapGridPainter grid;
79 Image componentOverlay;
80 float componentOverlayOpacity;
82 Colour currentBackgroundColour;
84 void removeAllElementComps();
85 void updateComponentOverlay();
86 void updateChildBounds();
90 #endif // __JUCER_PAINTROUTINEEDITOR_JUCEHEADER__